﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace YourFileWatcher.Models
{
    /// <summary>
    /// 一个存储日志文件的信息
    /// </summary>
    public class LogFileInfo
    {
        /// <summary>
        /// 日志文件名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 日志文件所在完整路径
        /// </summary>
        public string FullName { get; set; }

        /// <summary>
        /// 从文件初始化数据
        /// </summary>
        /// <param name="pFile">文件完整路径</param>
        /// <returns>实例</returns>
        internal static LogFileInfo FromFile(string pFileFullName)
        {
            var result = new LogFileInfo();
            result.Name = Path.GetFileName(pFileFullName);
            result.FullName = pFileFullName;

            return result;
        }
    }
}
